<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Usuario.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 
  </head>
  <body>
  	<f:view>
  		<div align="center">
  		<f:subview id="subview1">
			<jsp:include page="menu.jsp"></jsp:include>
		</f:subview>

<a4j:commandButton value="Logar"
					action="#{manterUsuario.clean}"
					onclick="#{rich:component('LoginPanel')}.show();return false;" />
  		<rich:modalPanel id="LoginPanel" width="550" height="250" style="overflow:auto">
		<f:facet name="header">
			<h:outputText value="Usuario" />
		</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
					<rich:componentControl for="LoginPanel" attachTo="hidelink2" operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		<a4j:form id = "formLogin" ajaxSingle="true">
			<a4j:outputPanel ajaxRendered="true">
				<h:panelGrid columns="2">
		    			<h:outputText value="Email:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.user.usuario}" size="40">
				    	</h:inputText>
			    			    	
			    	  	<h:outputText value="Senha:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.user.senha}" size="40" >
				    	</h:inputText>
			    	</h:panelGrid>
        		<rich:message showSummary="true" showDetail="false" for="price"/>
			</a4j:outputPanel>
			
			<br/><rich:separator/><br/>
			
			<h:panelGrid id="pgridLogin" columns="2">
			
				<a4j:commandButton value="Logar"
					action="#{manterUsuario.verificaSenha}" reRender="rpanel"
					oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('LoginPanel')}.hide();" />
				<a4j:commandButton value="Cancelar"
					action="#{manterUsuario.clean}"
					onclick="#{rich:component('LoginPanel')}.hide();return false;" />
			</h:panelGrid>	
		</a4j:form>
	</rich:modalPanel>

<form method="get" action="servlet/ChatServlet"> 
Name:<input type="TEXT" name="name"><br> 
E-mail:<input type="text" name="mail" value=""><br> 
Color:<input type="text" name="color" value="#000000"><br> 
<input type="Submit" value="Login"> 
</form> 

</div>
</f:view>
</body>
</html>
